#include <boost/test/unit_test.hpp>

#include "Object.h"
#include "Primitive.h"
#include "Sphere.h"

#include "Vector.h"
#include "Ray.h"
#include "Plane.h"

BOOST_AUTO_TEST_CASE(Sphere_Construction)
{
	Sphere *pS = new Sphere();
	delete pS;
}

BOOST_AUTO_TEST_CASE(Sphere_Intersection_Ray)
{
	Math::Ray r1(Math::Vector(0.0f, 0.0f, 0.0f), Math::Vector(0.5f, 0.5f, 0.0f).normal());
	Math::Ray r2(Math::Vector(0.0f, 0.0f, 0.0f), Math::Vector(0.0f, 1.0f, 0.0f).normal());

	Sphere s1(Math::Vector(10.0f, 10.0f, 0.0f), Math::Vector(0.0f, 0.0f, 0.0f), 100.0f);

    float t = 142857.0f;
	BOOST_REQUIRE(s1.intersects(r1, t, false));
	BOOST_REQUIRE(!s1.intersects(r2,t, false));
}
